package com.example.wordtext.controller;

import com.example.wordtext.service.DemoService;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
@AllArgsConstructor
@Validated
public class TestController {

    private final DemoService service;

    private final HttpServletResponse response;

    /**
     * 测试 docx 文档
     */
    @GetMapping("doc")
    public void test2(HttpServletResponse response) {
        service.downloadDocx(response);
    }

}